package org.softwarer.email.service;

import jakarta.annotation.Resource;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

/**
 * {@code @Author} 郝学胜
 * {@code @Date} 2025/11/13 15:37
 * {@code @Description}
 */
@Service
public class EMailService {



    @Resource
    private JavaMailSender javaMailSender;

    public void sendEmail(String to, String subject, String text) {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setTo(to);
        message.setFrom("2956576949@qq.com");
        message.setSubject(subject);
        message.setText(text);

        javaMailSender.send(message);
    }
}
